# Contributor: Leonardo Arena <rnalrd@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=ipvsadm
pkgver=1.31
pkgrel=3
pkgdesc="The IP Virtual Server administration utility"
url="http://www.linuxvirtualserver.org/software/ipvs.html"
arch="all"
license="GPL-2.0-or-later"
makedepends="libnl3-dev popt-dev linux-headers"
subpackages="$pkgname-doc $pkgname-openrc"
source="https://kernel.org/pub/linux/utils/kernel/ipvsadm/ipvsadm-$pkgver.tar.xz
	$pkgname.initd
	"
options="!check"

build() {
	make libs && make BUILD_ROOT="$pkgdir" \
		MANDIR=usr/share/man \
		SBIN="$pkgdir/usr/sbin" \
		INIT="$pkgdir/etc/init.d"
}

package() {
	make -j1 BUILD_ROOT="$pkgdir" \
		MANDIR=usr/share/man \
		SBIN="$pkgdir/usr/sbin" \
		INIT="$pkgdir/etc/init.d" \
		install

	# remove the 2 lines below (and this) if there is no init.d script
	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	# install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
}

sha512sums="1c7187405771e702eff0009d688fa697375b833a486ff88b41a4a0dcfaa3e9884c7e3bc34375efea5f6a2d025847c9fac9fd6ba694ec3bf2fc9d357eef2cb631  ipvsadm-1.31.tar.xz
23d90c882478e2809b5a0e4fa106a02b88033d316405b8c59018491b38ad03652767587f626ce29a476f9db77b458387f545995c9c0a99d04c0ddbdd733f030c  ipvsadm.initd"
